/-boot ...
BootController.ts
BootLayout.ts
StorageLoader.ts
boot.ts
/-docs
/-editor
/-files
/-files-old
/-imports
/-layout
/-storage
/-tests
/-typings
Dom.ts
TypeScriptService.ts
functions.ts
ko.ts
nteapo.html
persistence.api.ts
persistence.ts
shell.ts
teapo.html
teapo.ts
try.html
try.js
x
module teapo.boot {
117
        alert('Detection '+err.message);
118
        return;
119
      }
120
121
      this._persistenceName = name;
122
      this._editedUTC = editedUTC;
123
      this._supportsPersistence = supportsPersistence;
124
125
      this._layout.setProgressColor('goldenrod');
126
      this._layout.setSmallProgressText('Loading files from ' + name + ' edited on ' + new Date(editedUTC) + '...');
127
    }
128
129
    private _storageLoadProgress(
130
      totalFileCount: number,
131
      loadedFileCount: number,
132
      lastLoadedFileName: string) {
133
134
      this._layout.setProgressColor('green');
135
      this._layout.setSmallProgressText('Loading "' + lastLoadedFileName + '" ' + loadedFileCount + ' of ' + totalFileCount + '...');
136
    }
137
138
    private _storageLoaded(
139
      err: Error,
140
      byFullPath: { [fullPath: string]: { [property: string]: string; }; },
141
      domUpdater: storage.attached.UpdateStorage,
142
      persistenceUpdater: storage.attached.UpdateStorage) {
143
      if (err) {
144
        alert('Loading ' + err.message);
145
        return;
146
      }
147
148
      this._layout.setProgressColor('black');
149
      this._layout.setSmallProgressText('Loaded files from ' + this._persistenceName + ' edited on ' + new Date(this._editedUTC) + '...');
150
      
151
      addEventListener(window, 'keydown', (evt: KeyboardEvent) => {
152
        if (evt.keyCode === 83 && evt.ctrlKey) {
153
          saveCurrentHtmlAsIs();
154
          if (evt.preventDefault) evt.preventDefault();
155
          if ('cancelBubble' in evt) evt.cancelBubble = true;
156
        }
157
      });
158
    }
159
160
    private _getUniqueKey() {
161
      var key = window.location.pathname;
162
163
      key = key.split('?')[0];
164
      key = key.split('#')[0];
165
166
      key = key.toLowerCase();
167
168
      var ignoreSuffix = '/index.html';
169
170
      if (key.length > ignoreSuffix.length && key.slice(key.length - ignoreSuffix.length) === ignoreSuffix)
171
        key = key.slice(0, key.length - ignoreSuffix.length);
172
173
      key += '*';
174
175
      return key;
176
    }
177
178
  }
179
180
}
157:0